library(ggplot2)
Registered S3 method overwritten by 'dplyr':
method from
print.rowwise_df
Find out what's changed in ggplot2 at https://github.com/tidyverse/ggplot2/releases.
Download data from Ocean Adapt
Plot taxa by region by year to look for taxa that aren’t recorded consistently
sppbyyr <- trawl[, .(pres = length(spp)), by = .(region, year, spp)]
regs <- sppbyyr[, sort(unique(region))]
# loop through each region and make a plot
for(i in 1:length(regs)){
p1 <- ggplot(sppbyyr[region == regs[i]], aes(x = year, y = spp, group = spp)) +
geom_line(size = 0.2) +
geom_point(size = 0.2) +
theme(text=element_text(size = 3),
axis.text.x = element_text(angle = 90),
strip.text.x = element_text(size = 5)) +
ggtitle(regs[i])
print(p1)
}





